/*
 * @Author: your name
 * @Date: 2021-08-26 11:34:08
 * @LastEditTime: 2021-08-26 16:44:30
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day04\5-例子.js
 */

//
function print() {
    console.log(arguments);
    //for...in...
    for (var key in arguments) {
        console.log(arguments[key] + "t");
    }
    //for
    for (var i = 0; i < arguments.length; i++) {
        //var key=toString(i);
        //var key=String(i);
        var key = "" + i;
        console.log(arguments[key] + "w");
    }
}
print(1);
print('hello', 'world');
print(1, 2, 3, 4, 5, 6, 7, 8, 9);





// 形参和实参有绑定关系，函数内部：形参变量名就与arguments[key]发生绑定
function add(v1, v2) {
    v1 = 'a';
    v2 = 'b';
    //arguments['0']="hello";
    //arguments['1']='world';
    console.log(v1, v2, arguments['0'], arguments['1']);
}
add();
add(100);
add(100, 200);
add(100, 200, 300);